package com.avamstudios;

import java.util.ArrayList;
import java.util.List;

public class MyFactory {	
	int counter = 0;
	int messangerLimit = 5;
	
	Messanger lastMessanger;
	
	public MyFactory(){
		System.out.println("Fabrika kuruldu.");
	}
	
	public Messanger createMessanger(){
		System.out.println("Fabrikada saat : "+System.currentTimeMillis());
		if(counter%messangerLimit == 0){
			System.out.println("Yeniye ihtiyac var.");
			lastMessanger = new Messanger();
		}
		counter++;
		return lastMessanger;
	}
	
}
